package com.wlh.animation.basic;/*
 * Copyright (C) 2016 Facishare Technology Co., Ltd. All Rights Reserved.
 */

import com.wlh.animation.R;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.animation.ScaleAnimation;

/**
 * Created by weilh on 2016/1/22.
 */
public class ScaleAnimationAct extends AppCompatActivity {
    private View view;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rotate_anim);
        view = findViewById(R.id.view);
        setTitle("缩放动画");
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ScaleAnimation anim = new ScaleAnimation(0f, 1f, 0f, 1f, view.getWidth() / 2f, view.getHeight() / 2f);
                anim.setDuration(2000);
                view.startAnimation(anim);
            }
        });
    }
}


